getaddrinfo-is-threadsafe
authorSteve Langasek <vorlon@debian.org>
Sat, 23 Jan 2021 16:57:07 +0000 (16:57 +0000)
committerRyan Tandy <ryan@nardis.ca>
Sat, 23 Jan 2021 16:57:07 +0000 (16:57 +0000)
commitae7a07b46855ff030f4f4ede7a0473b5f666c8dc
tree64d5365cd78ab6ece0b70764eebf02d51d3fb5b8
parentd3de074bfada0f6e5bfc8e22e82d7fab2136deaa
getaddrinfo-is-threadsafe

OpenLDAP upstream conservatively assumes that certain resolver functions
(getaddrinfo, getnameinfo, res_query, dn_expand) are not re-entrant; but we
know that the glibc implementations of these functions are thread-safe, so
we should bypass the use of this mutex.  This fixes a locking problem when
an application uses libldap and libnss-ldap is also used for hosts
resolution.

Closes Debian bug #340601.

Not suitable for forwarding upstream; might be made suitable by adding a
configure-time check for glibc and disabling the mutex only on known
thread-safe implementations.

Gbp-Pq: Name getaddrinfo-is-threadsafe
libraries/libldap/os-ip.c
libraries/libldap/util-int.c